﻿using AbpApplication.AppServices;
using AbpApplication.AppServices.BaseRequest;
using AbpApplication.InPut;
using Hangfire;
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Identity.Client;

namespace AbpWebapi.Controllers
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class BaseServiceController : ControllerBase
    {

        private readonly IBaseService _baseService;
  

        public BaseServiceController(IBaseService baseService)
        {
            _baseService = baseService;
          
        }

        [HttpPost]
        public async Task <ApiResponse>   test(bool Enabled) => await _baseService.test(Enabled);
        [HttpPost]
        public async Task<ApiResponse> CreatePosition(Request_Base1 Request)=>await _baseService.CreatePosition(Request);
        [HttpPost]
        [Authorize(Roles = "产线,管理员")]
        public async Task<ApiResponse> CreateTaskOrder(Request_Base2 Request)=>await _baseService.CreateTaskOrder(Request);
        [HttpPost]
        public async Task<ApiResponse> GetView_TaskOrder() => await _baseService.GetView_TaskOrder();
        [HttpPost]
        public async  Task<ApiResponse> CallAGVBack(CallByRequest Request)=>await _baseService.CallAGVBack(Request);
        [HttpPost]
        public async Task<ApiResponse> GetView_PositionState(Request_Base3 Request) => await _baseService.GetView_PositionState(Request);
        [HttpPost]
        public async Task<ApiResponse> CancelTaskOrder(Request_Base4 Request) => await _baseService.CancelTaskOrder(Request);
        [HttpPost]
        public async Task<ApiResponse> CreateMaterialList(Request_Base5 Request) => await _baseService.CreateMaterialList(Request);
        [HttpPost]
        public async Task<ApiResponse> GetMaterialList(Request_Base6 Request) => await _baseService.GetMaterialList(Request);
        [HttpPost]
        public async Task<ApiResponse> SearchMaterialList(Request_Base7 Request) => await _baseService.SearchMaterialList(Request);
        [HttpPost]
        public async Task<ApiResponse> PollingTask() => await _baseService.PollingTask();
        [HttpPost]
        [Authorize(Roles = "仓库,管理员")]
        public async Task<ApiResponse> CreateToCacheTaskOrder(Request_Base8 Request)=>await _baseService.CreateToCacheTaskOrder(Request);
        [HttpPost]
        [Authorize(Roles = "产线,管理员")]
        public async Task<ApiResponse> CreateFromCachaTaskOrder()=> await _baseService.CreateFromCachaTaskOrder();
        [HttpPost]
        public async Task<ApiResponse> DeleteTaskInfo(Guid taskinfo_Id)=>await _baseService.DeleteTaskInfo(taskinfo_Id);
        [HttpPost]
        public async Task<ApiResponse> GetView_TaskOrderInfo() => await _baseService.GetView_TaskOrderInfo();
    }
}
